package dm71.espil.activities;

import dm71.espil.R;
import dm71.espil.R.id;
import dm71.espil.R.layout;
import dm71.espil.REST.DataService;
import dm71.espil.models.Highscore;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class HighscoreTestActivity extends Activity
{
	Button btnAddHighscore;
	DataService service;
	HighscoreTestActivity context = this;
	
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.testhighscore);
		
		service = new DataService();
		
		btnAddHighscore = (Button)findViewById(R.id.btnAddHighscore);
		btnAddHighscore.setOnClickListener(new View.OnClickListener()
		{
			public void onClick(View v)
			{
				Highscore[] highscores = service.GetHighscores(10);
				Toast.makeText(context, String.valueOf(highscores.length), 5000).show();
			}
		});
	}
}
